package com.exigenservices.practice.roadcompanion.entity;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Konstantin
 * Date: 10.07.13
 * Time: 16:43
 * To change this template use File | Settings | File Templates.
 */

@Entity
@Table(name = "userrouters")
public class UserRoutes {
    @ManyToOne
    @JoinColumn(name = "ID")
    private User ID;

    @Column(name = "userID")
    private Long userID;

    @Column(name = "date")
    private Date date;

    @Column(name = "time")
    private Time time;

    @OneToMany(mappedBy = "route")
    private List<Points> points;

    public UserRoutes(){
    }

    @Id
    @GeneratedValue
    public Long getID(){
        return ID.getID();
    }
    protected void setID(Long id){
        this.ID.setID(id);
    }

    public Long getUserID(){
        return userID;
    }
    public void setUserID(Long id){
        this.userID = id;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date")
    public Date getDate(){
        return date;
    }
    public void setDate(Date date){
        this.date = date;
    }

    @Temporal(TemporalType.TIME)
    @Column(name = "time")
    public Time getTime(){
        return time;
    }
    public void setTime(Time time){
        this.time = time;
    }
}
